<?php
/**
 * 处理班级添加修改表单
 */
include "../util/DBUtil.php";
include '../util/PromptAction.php';


$id = $_POST['id'];
$grade = $_POST['grade'];

$db = new DBUtil();
$sql = "";
$params = array();


if ($id != '') {//修改操作
    $sql = "update tb_grade set grade=? where id=? ";
    $params = array($grade,$id);
}else{
    $sql = "insert into tb_grade(grade) value(?) ";
    $params = array($grade);
}
$statue = $db->update($sql, $params);
showStatue($statue);
echo "<script>window.open('../view/student.php','info')</script>";
